﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using System.Diagnostics;
using System.ComponentModel;
using WPFExcelReport.Helpers;
using System.Windows.Input;
namespace WPFExcelReport
{
    public partial class TDWT15
    {
        public TDWT15()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VWTSAER();
            this.DataContext = MV;
            InitializeComponent();
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
            TMV.Pattern(dwMaster);
            INFO = TMV.INFO;
        }
     

        public override void LOADBYAUF()
        {
            if (!IsCanLoad)
                return;
            TBMain.Clear();
            if (ORDERNUM.Length < 15)
                return; 
            dwData = TBMain.NewRow();
            dwData["WTBMANDANT"] = app.Mandant;
            dwData["WTBSRFNR"] = " AND WTBSRFNR = '" + ORDERNUM.Substring(0, 15) + "'";
            SResult = TMV.QWT03(dwData);
            MergeData(SResult, true);
        }
        
    }
}
